'use strict'

const pg = require('pg')

let psql = new pg.Pool({
    database:'wert',
    user:'wert',
    port:5432,
    host:'127.0.0.1',
    password:'qwert12345',
    max:5
})
;(async ()=>{
    let tn = Date.now()

    let id = `${Math.random().toString(2)}`
    
    let sqltext = `INSERT INTO`
    +`content(id,detail,title,add_time,update_time)`
    +`VALUES($1,$2,$3,$4,$5)`
    
    let r =await psql.query(sqltext,[
        id, `测试内容:${Math.random()}`,`text`,
        tm,tm
    ])

    console.log(r)
    psql.end()
})();

